From: Punit Agrawal Date: Fri, 26 May 2017 11:14:06 +0000 (+0100) Subject: arm: p2m: Prevent redundant icache flushes X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2085 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=1a0c3e3e28d6cd072734990efcaaec608bf152b1;p=xen.git arm: p2m: Prevent redundant icache flushes When toolstack requests flushing the caches, flush_page_to_ram() is called for each page of the requested domain. This needs to unnecessary icache invalidation operations. Let's take the responsibility of performing icache operations and use the recently introduced flag to prevent redundant icache operations by flush_page_to_ram(). Signed-off-by: Punit Agrawal Reviewed-by: Stefano Stabellini --- diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 291998938e..b7bbea1d81 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1398,13 +1398,15 @@ int p2m_cache_flush(struct domain *d, gfn_t start, unsigned long nr) /* XXX: Implement preemption */ while ( gfn_x(start) < gfn_x(next_gfn) ) { - flush_page_to_ram(mfn_x(mfn), true); + flush_page_to_ram(mfn_x(mfn), false); start = gfn_add(start, 1); mfn = mfn_add(mfn, 1); } } + invalidate_icache(); + p2m_read_unlock(p2m); return 0;